from numpy.lib import math

def BD2WGS(lng,lat):
    x_pi = 3.14159265358979324 * 3000.0 / 180.0
    x = lng - 0.0065
    y = lat - 0.006
    z = math.sqrt(x * x + y * y) + 0.00002 * math.sin(y * x_pi)
    theta = math.atan2(y, x) + 0.000003 * math.cos(x * x_pi)
    lngs = z * math.cos(theta)
    lats = z * math.sin(theta)
    return lngs,lats